package com.sg.controller.bff;

import com.sg.service.biz.bff.PasswordService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.BffUpdateCaptchaChangePasswordRespDto;
import com.sg.dto.biz.bff.res.BffUpdateChangePasswordRespDto;
import com.sg.dto.biz.bff.res.BffUpdateForgotPasswordRespDto;
import com.sg.dto.biz.bff.res.BffUpdateSetNewPasswordRespDto;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
//import com.wicket.okrapp.integration.dto.ImplementPushCacheSendMessageChannelComRespDto;
//import com.wicket.okrapp.integration.dto.ImplementPushCacheSendMessageChannelComReqDto;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Password", tags = {"Password"})
@RestController
// @RequestMapping("/oms/password/")
public class PasswordController {

    @Autowired
    PasswordService passwordService;

    /**
     * B1-2原密码修改密码
     * gen by moon at 8/10/2022, 3:33:10 AM
     */
    @PostMapping("/oms/password/updateChangePassword")
    @ApiOperation(value = "B1-2原密码修改密码", response = OkrResult.class)
    public OkrResult<BffUpdateChangePasswordRespDto> updateChangePassword(@RequestBody(required = false) @Validated BffUpdateChangePasswordReqDto reqDTO) {
        return OkrResult.success(passwordService.updateChangePassword(reqDTO));
    }

    /**
     * B1-2验证码修改密码
     * gen by moon at 8/10/2022, 3:33:11 AM
     */
    @PostMapping("/oms/password/updateCaptchaChangePassword")
    @ApiOperation(value = "B1-2验证码修改密码", response = OkrResult.class)
    public OkrResult<BffUpdateCaptchaChangePasswordRespDto> updateCaptchaChangePassword(@RequestBody(required = false) @Validated BffUpdateCaptchaChangePasswordReqDto reqDTO) {
        return OkrResult.success(passwordService.updateCaptchaChangePassword(reqDTO));
    }

    /**
     * B1-2忘记密码新密码
     * gen by moon at 8/10/2022, 3:29:30 AM
     */
    @PostMapping("/oms/password/updateSetNewPassword")
    @ApiOperation(value = "B1-2忘记密码新密码", response = OkrResult.class)
    public OkrResult<BffUpdateSetNewPasswordRespDto> updateSetNewPassword(@RequestBody(required = false) @Validated BffUpdateSetNewPasswordReqDto reqDTO) {
        return OkrResult.success(passwordService.updateSetNewPassword(reqDTO));
    }

    /**
     * B1-2修改忘记密码
     * gen by moon at 9/14/2022, 4:11:27 PM
     */
    @PostMapping("/oms/password/updateForgotPassword")
    @ApiOperation(value = "B1-2修改忘记密码", response = OkrResult.class)
    public OkrResult<BffUpdateForgotPasswordRespDto> updateForgotPassword(@RequestBody(required = false) @Validated BffUpdateForgotPasswordReqDto reqDTO) {
        return OkrResult.success(passwordService.updateForgotPassword(reqDTO));
    }
}
